package com.jandar.controller;

import com.alibaba.fastjson.JSONObject;
import com.jandar.entity.ExcelPerson;
import com.jandar.service.ExcelPersonService;
import com.jandar.service.StatisticsPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/AnalyzeAndStatisticPerson")
public class StatisticsPersonController {
    @Autowired
    ExcelPersonService personService;
    @Autowired
    StatisticsPersonService statisticsPersonService;


    @GetMapping("listPerson")
    public JSONObject listPerson() {
        return statisticsPersonService.listPerson();
    }

    @PostMapping("pageAllPersonInfoByRel")
    public JSONObject pageAllPersonInfoByRel(@RequestBody StatisticsPersonService.PageParam param, HttpServletRequest request) {
        return statisticsPersonService.pageAllPersonInfoByRel(param, request);
    }

    @PostMapping("pagePersonInfoByRel")
    public JSONObject pagePersonInfoByRel(@RequestBody StatisticsPersonService.PageParam param, HttpServletRequest request) {
        return statisticsPersonService.pagePersonInfoByRel(param, request);
    }

//    @PostMapping("pagePerson")
//    public JSONObject pagePerson(@RequestBody StatisticsPersonService.PageParam param, HttpServletRequest request) {
//        return statisticsPersonService.pagePerson(param, request);
//    }

//    @PostMapping("addPerson")
//    public JSONObject addPerson(@RequestBody ExcelPerson person) {
//        return statisticsPersonService.addPerson(person);
//    }
//
//    @PostMapping("editPerson")
//    public JSONObject editPerson(@RequestBody ExcelPerson person) {
//        return statisticsPersonService.editPerson(person);
//    }
//
//    @GetMapping("deletePerson")
//    public JSONObject deletePerson(Integer personId) {
//        return statisticsPersonService.deletePerson(personId);
//    }
//
//
//    @PostMapping("pagePersonInfo")
//    public JSONObject pagePersonInfo(@RequestBody StatisticsPersonService.PageParam param) {
//        return statisticsPersonService.pagePersonInfo(param);
//    }
//
//    @PostMapping("addPersonInfo")
//    public JSONObject addPersonInfo(@RequestBody StatisticsPersonInfo personInfo) {
//        return statisticsPersonService.addPersonInfo(personInfo);
//    }
//
//    @PostMapping("editPersonInfo")
//    public JSONObject editPersonInfo(@RequestBody StatisticsPersonInfo personInfo) {
//        return statisticsPersonService.editPersonInfo(personInfo);
//    }
//
//    @GetMapping("deletePersonInfo")
//    public JSONObject deletePersonInfo(Long personInfoId) {
//        return statisticsPersonService.deletePersonInfo(personInfoId);
//    }
}
